package com.zb.vo.os;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Title 系统调用的返回信息VO类
 * @author zhoutian   
 * @date 2015-12-28
 */
public class RetVO {
	/** 调用返回码，表示本次业务调用/处理是否成功：success:成功   fail:失败 */
	private String retCode;
	/** 业务返回码，代表了调用/处理失败的原因 */
	private String resultCode = "1020300";
	/** 调用/处理成功的返回数据 */
	private String bizData;

	public String getRetCode() {
		return retCode;
	}

	public void setRetCode(String retCode) {
		this.retCode = retCode;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

	public Object getBizData() {
		return bizData;
	}

	public void setBizData(Object bizData) {
		this.bizData = JSON.toJSONStringWithDateFormat(bizData, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat);
	}

	public RetVO() {}
	
	public RetVO(String retCode, String resultCode, String bizData) {
		this.retCode = retCode;
		if(resultCode != null) this.resultCode = resultCode;
		this.bizData = bizData;
	}
	
	public static final String SuccessCode = "success";
	
	public static final String FailCode = "fail";
	
	public String toJSONString(){
		return JSON.toJSONStringWithDateFormat(this, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat);
	}

	public static class CreatedOrderVO
	{
		//订单号
		private String orderNo;
		//主服务名称
		private String mainServiceName;
		//总金额
		private BigDecimal totalFee;
		//订单项信息列表
		private List<ServicePriceVO> orderItemVOList;

		public String getOrderNo()
		{
			return orderNo;
		}

		public void setOrderNo(String orderNo)
		{
			this.orderNo = orderNo;
		}

		public String getMainServiceName()
		{
			return mainServiceName;
		}

		public void setMainServiceName(String mainServiceName)
		{
			this.mainServiceName = mainServiceName;
		}

		public BigDecimal getTotalFee()
		{
			return totalFee;
		}

		public void setTotalFee(BigDecimal totalFee)
		{
			this.totalFee = totalFee;
		}

		public List<ServicePriceVO> getOrderItemVOList()
		{
			return orderItemVOList;
		}

		public void setOrderItemVOList(List<ServicePriceVO> orderItemVOList)
		{
			this.orderItemVOList = orderItemVOList;
		}
	}


	/**
	 * @author zhoutian
	 * @Title 服务价格查询的返回对象
	 * @date 2015-11-26
	 */
	public static class ServicePriceVO
	{
		//服务编号
		private String serviceNo;
		//服务名称
		private String serviceName;
		//购买数量，如预约时间、电量等
		private BigDecimal buyNum;
		//原始价格
		private BigDecimal originalPrice;
		//优惠后价格
		private BigDecimal realPrice;

		public String getServiceNo()
		{
			return serviceNo;
		}

		public void setServiceNo(String serviceNo)
		{
			this.serviceNo = serviceNo;
		}

		public String getServiceName()
		{
			return serviceName;
		}

		public void setServiceName(String serviceName)
		{
			this.serviceName = serviceName;
		}

		public BigDecimal getBuyNum()
		{
			return buyNum;
		}

		public void setBuyNum(BigDecimal buyNum)
		{
			this.buyNum = buyNum;
		}

		public BigDecimal getOriginalPrice()
		{
			return originalPrice;
		}

		public void setOriginalPrice(BigDecimal originalPrice)
		{
			this.originalPrice = originalPrice;
		}

		public BigDecimal getRealPrice()
		{
			return realPrice;
		}

		public void setRealPrice(BigDecimal realPrice)
		{
			this.realPrice = realPrice;
		}

		public ServicePriceVO()
		{
		}
	}
	
	public static class OrdersStatus
	{
		//订单号
		private String orderNo;
		//订单状态编码   //(0, "已下单，未支付"),(1, "正在支付"),(2, "未审核"),(3, "正在审核"),(4, "已确认"),(5, "备货中"),(6, "已发货"),(7, "已支付，已完成"),(8, "已取消，已完成"),(9, "已超期，已完成")
		private String statusCode;
		//订单状态
		private String status;
		public String getOrderNo() {
			return orderNo;
		}
		public void setOrderNo(String orderNo) {
			this.orderNo = orderNo;
		}
		public String getStatusCode() {
			return statusCode;
		}
		public void setStatusCode(String statusCode) {
			this.statusCode = statusCode;
		}
		public String getStatus() {
			return status;
		}
		public void setStatus(String status) {
			this.status = status;
		}
		
	}
}
